package xcmg.device.infra.enums;

/**
 * 过账状态
 *
 * @author wangyong1015
 */
public enum PostingStatusEnum {
    NO_POSTING(0, "未过账"),
    PART_POSTING(1, "部分过账"),
    ALL_POSTING(2, "已过账");

    private Integer statusCode;

    private String statusName;

    PostingStatusEnum(Integer statusCode, String statusName) {
        this.statusCode = statusCode;
        this.statusName = statusName;
    }

    public Integer getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(Integer statusCode) {
        this.statusCode = statusCode;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public static String getDescByCode(Integer status) {
        for (PostingStatusEnum statusEnum : PostingStatusEnum.values()) {
            if (statusEnum.getStatusCode().equals(status)) {
                return statusEnum.getStatusName();
            }
        }
        return NO_POSTING.getStatusName();
    }
}
